import { Component , PureComponent } from "react";
import connect from './../../redux/connect';
import Link from './../../component/CustomLink';

class BookOrder extends PureComponent{
    constructor(){
        super()
    }
    render(){
        let { lists } = this.props ;
        if(lists && lists.length > 0){
            return <div>
                {lists.map((items,i) => {
                    return (
                        <div className="list-content" key={i}>
                            <div className="header-title">
                                <div className="title-list">
                                    <img src={items.images.large}/>
                                    <h2>{items.title}</h2>
                                </div>
                                <div className="title-list">
                                    <a className="more">更多</a>
                                </div>
                            </div>
                            {/* <div className="movie-list-box"  ref='runBox'>
                                <ul className="page-list swiper-wrapper" style= {{width: lists.length * 5.25 + 'rem'}}>
                                    {(items.images || []).map((item,index) => {
                                        console.log(item);
                                        return (
                                            <li className="list swiper-slide" key={index}>
                                                <Link to={'/MovieDetail/'+ item.id}>
                                                    <div className="movie-img" style={{backgroundImage:'url('+item.images.large+')'}}>
                                                    </div>
                                                    <div className="item-content">
                                                        <p className="ellipsis">{item.title}</p>
                                                        <div className="rank">
                                                            <span className="start-full"></span>
                                                            <span className="start-full"></span>
                                                            <span className="start-full"></span>
                                                            <span className="start-full"></span>
                                                            <span className="start-full"></span>
                                                            <span className="rank-number">{item.rating.average}</span>
                                                        </div>
                                                    </div>
                                                </Link>
                                            </li>
                                        )
                                    })}
                                </ul>
                            </div> */}
                        </div>
                    )
                })}
            </div>
        }else{
            return  <div>没有数据哈~</div>            
        }
            
    }
}

import indexAction from './../../redux/actions/indexActions';

export default connect({
    actions:{
        indexAction
    },
    reducers:{
        indexReducer:"indexReducer"
    }
})( BookOrder );
